import Vue from 'vue'
import App from './App'
import appInfo from './appInfo'
import mNetTool from "./tools/NetTool.js"
import NetTool from '@/common/js/axion.js'
import {payfor} from '@/common/js/payTool.js' 
import {
	msg,
	isLogin,
	debounce,
	throttle,
	prePage,
	date,
	getDom,
	getAudioUrl,
	playAudioText,
	playAudioUrl,
	upadteApp,
	getFileCache
} from '@/common/js/util'

Vue.prototype.appInfo=appInfo;
Vue.prototype.mNetTool=mNetTool;
Vue.prototype.NetTool=new NetTool();
Vue.prototype.$util = {
	msg,
	isLogin,
	debounce,
	throttle,
	prePage,
	date,
	getDom,//获取dom信息
	getAudioUrl,
	playAudioText,
	playAudioUrl,
	payfor,
	upadteApp,
	getFileCache
}
// vuex
import store from './store'
// import BaiduMap from 'vue-baidu-map'
// Vue.use(BaiduMap,{
// 	  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
// 	  ak: 'eUQGDUvs6UVmqBc7xwxoiOIA98uKm8eE'
// })
// 引入全局uView
import uView from '@/uni_modules/uview-ui'
const initMixin = require('./static/js/initMixin.js')
Vue.mixin(initMixin);
// import mixin from './common/mixin/mixin'

Vue.prototype.$store = store

Vue.config.productionTip = false

App.mpType = 'app'
Vue.use(uView)
// #ifdef APP-PLUS
	let main = plus.android.runtimeMainActivity();
	//为了防止快速点按返回键导致程序退出重写quit方法改为隐藏至后台  
	plus.runtime.quit = function() {
		main.moveTaskToBack(false);
	};
	//重写toast方法如果内容为 ‘再次返回退出应用’ 就隐藏应用，其他正常toast 
	plus.nativeUI.toast = (function(str) {
		if (str =='再次返回退出应用') {
			plus.runtime.quit();
		} else {
			uni.showToast({
				title: '再次返回退出应用',
				icon: 'none'
			})
		}
	});

// #endif
// #ifdef MP
// 引入uView对小程序分享的mixin封装
const mpShare = require('./uni_modules/uview-ui/libs/mixin/mpShare.js')
Vue.mixin(mpShare)
// #endif

// Vue.mixin(mixin)

const app = new Vue({
    store,
    ...App
})

// 引入请求封装
// require('./util/request/index')(app)

app.$mount()
